{extend name="base" /}
{block name="body"}
<style type="text/css">
    .mleft {
        margin-right: 10px;
    }
</style>
<div class="layui-body">
    <!--tab标签-->
    <div class="layui-tab layui-tab-brief">
        <ul class="layui-tab-title">
            <li class="layui-this">角色管理</li>
        </ul>
        <div class="layui-tab-content">
            <div class="layui-tab-item layui-show">
                <div class="layui-form-item">
                    <form class="layui-form layui-form-pane" action="{:url('/admin/role')}" method="get">
                        <div class="layui-inline">
                            <label class="layui-form-label">角色名称</label>
                            <div class="layui-input-inline">
                                <input type="text" name="name" value="{:input('name')}" placeholder="角色名称" class="layui-input">
                            </div>
                        </div>

                        <div class="layui-inline mleft">
                            <label class="layui-form-label">玩家UID</label>
                            <div class="layui-input-inline">
                                <input type="text" name="uid" value="{:input('uid')}" placeholder="请输入玩家uid" class="layui-input">
                            </div>
                        </div>

                        <div class="layui-inline mleft">
                            <label class="layui-form-label">游戏</label>
                            <div class="layui-input-inline" style="width: 120px;">
                                <select name="game" lay-filter="game" id="game" lay-search>
                                    <option value="">请选择游戏</option>
                                    {foreach name=":get_agent_game()" item="vo"}
                                        <option value="{$vo.id}"{if condition="input('game') == $vo.id"}selected{/if}>{$vo.name}</option>
                                    {/foreach}
                                </select>
                            </div>
                        </div>

                        <div class="layui-inline mleft">
                            <label class="layui-form-label">选择渠道</label>
                            <div class="layui-input-inline" style="width: 120px;">
                                <select name="cid" lay-filter="cid" id="cid" lay-search>
                                    <option value=""{if condition="input('cid') == ''"}>请选择渠道</option>
                                    <option value="0"{if condition="input('cid') === '0'"}selected{/if}>系统</option>
                                    {foreach name=":get_channel_list()" item="vo"}
                                        <option value="{$vo.id}"{if condition="input('cid') == $vo.id"}selected{/if}>{$vo.platform}</option>
                                    {/foreach}
                                </select>
                            </div>
                        </div>

                        <div class="layui-inline">
                            <button class="layui-btn">搜索</button>
                        </div>
                    </form>
                </div>
                <hr>

                <table class="layui-table">
                    <thead>
                    <tr>
                        <th style="width: 45px;">ID</th>
                        <th style="width: 30px;">UID</th>
                        <th style="width: 30px;">玩家账号</th>
                        <th style="width: 30px;">渠道名称</th>
                        <th style="width: 120px;">游戏名称</th>
                        <th style="width: 60px;">角色id</th>
                        <th style="width: 45px;">角色名称</th>
                        <th style="width: 45px;">角色等级</th>
                        <th style="width: 30px;">角色战力</th>
                        <th style="width: 30px;">上传时间</th>
                    </tr>
                    </thead>
                    <tbody>
                    {foreach name="game_list" item="vo"}
                    <tr>
                        <td>{$vo.id}</td>
                        <td>{$vo.uid}</td>
                        <td>{:get_player($vo['uid'],'account')}</td>
                        <td>{:get_channel_name($vo['cid'])}</td>
                        <td>{:get_game_filed($vo['gid'],'name')}</td>
                        <td>{$vo.role_id}</td>
                        <td>{$vo.role_name}</td>
                        <td>{$vo.role_level}</td>
                        <td>{$vo.role_power}</td>
                        <td>{$vo.update_time}</td>
                    </tr>
                    {/foreach}
                    </tbody>
                </table>
                <!--分页-->
                {:$reg_list->render()}
            </div>
        </div>
    </div>
</div>
{/block}

{block name="script"}
<script>
</script>
{/block}